#ifndef AAC_ENCODER_H
#define AAC_ENCODER_H

#include <fdk-aac/aacenc_lib.h>
#include <cstdio>
#include <memory>

class AACEncoder :public EncodeBase {
public:
    AACEncoder(int sampleRate, int channels, int bitrate, AudioEncDataObserver* p = nullptr);
    ~AACEncoder();

    virtual void encode(void* data, size_t dataSize, long long pts);

private:
    HANDLE_AACENCODER encoder_;
    AACENC_InfoStruct encoderInfo_;
    int inputChannels_;
    std::unique_ptr<char[]> audio_buffer_;
    int audio_buffer_len_ = 0;
    AudioEncDataObserver* ob_;
};

#endif // AAC_ENCODER_H
